// Copyright 2024 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// Code generated by sidekick. DO NOT EDIT.

pub mod secret_manager_service {
    use crate::Result;

    /// A builder for [SecretManagerService][crate::client::SecretManagerService].
    ///
    /// ```
    /// # tokio_test::block_on(async {
    /// # use secretmanager_openapi_v1::*;
    /// # use builder::secret_manager_service::ClientBuilder;
    /// # use client::SecretManagerService;
    /// let builder : ClientBuilder = SecretManagerService::builder();
    /// let client = builder
    ///     .with_endpoint("https://secretmanager.googleapis.com")
    ///     .build().await?;
    /// # gax::client_builder::Result::<()>::Ok(()) });
    /// ```
    pub type ClientBuilder =
        gax::client_builder::ClientBuilder<client::Factory, gaxi::options::Credentials>;

    pub(crate) mod client {
        use super::super::super::client::SecretManagerService;
        pub struct Factory;
        impl gax::client_builder::internal::ClientFactory for Factory {
            type Client = SecretManagerService;
            type Credentials = gaxi::options::Credentials;
            async fn build(
                self,
                config: gaxi::options::ClientConfig,
            ) -> gax::client_builder::Result<Self::Client> {
                Self::Client::new(config).await
            }
        }
    }

    /// Common implementation for [crate::client::SecretManagerService] request builders.
    #[derive(Clone, Debug)]
    pub(crate) struct RequestBuilder<R: std::default::Default> {
        stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        request: R,
        options: gax::options::RequestOptions,
    }

    impl<R> RequestBuilder<R>
    where
        R: std::default::Default,
    {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self {
                stub,
                request: R::default(),
                options: gax::options::RequestOptions::default(),
            }
        }
    }

    /// The request builder for [SecretManagerService::list_locations][crate::client::SecretManagerService::list_locations] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::ListLocations;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListLocations {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListLocations(
        RequestBuilder<crate::model::secret_manager_service::ListLocationsRequest>,
    );

    impl ListLocations {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::secret_manager_service::ListLocationsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListLocationsResponse> {
            (*self.0.stub)
                .list_locations(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::ListLocationsResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone().unwrap_or_default();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<crate::model::ListLocationsResponse, gax::error::Error>
        {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [project][crate::model::secret_manager_service::ListLocationsRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [filter][crate::model::secret_manager_service::ListLocationsRequest::filter].
        pub fn set_filter<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.filter = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [filter][crate::model::secret_manager_service::ListLocationsRequest::filter].
        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.filter = v.map(|x| x.into());
            self
        }

        /// Sets the value of [page_size][crate::model::secret_manager_service::ListLocationsRequest::page_size].
        pub fn set_page_size<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i32>,
        {
            self.0.request.page_size = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [page_size][crate::model::secret_manager_service::ListLocationsRequest::page_size].
        pub fn set_or_clear_page_size<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i32>,
        {
            self.0.request.page_size = v.map(|x| x.into());
            self
        }

        /// Sets the value of [page_token][crate::model::secret_manager_service::ListLocationsRequest::page_token].
        pub fn set_page_token<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.page_token = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [page_token][crate::model::secret_manager_service::ListLocationsRequest::page_token].
        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.page_token = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListLocations {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::get_location][crate::client::SecretManagerService::get_location] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::GetLocation;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetLocation {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetLocation(
        RequestBuilder<crate::model::secret_manager_service::GetLocationRequest>,
    );

    impl GetLocation {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::secret_manager_service::GetLocationRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Location> {
            (*self.0.stub)
                .get_location(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::secret_manager_service::GetLocationRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [location][crate::model::secret_manager_service::GetLocationRequest::location].
        ///
        /// This is a **required** field for requests.
        pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.location = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetLocation {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::list_secrets][crate::client::SecretManagerService::list_secrets] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::ListSecrets;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListSecrets {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListSecrets(
        RequestBuilder<crate::model::secret_manager_service::ListSecretsRequest>,
    );

    impl ListSecrets {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::secret_manager_service::ListSecretsRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListSecretsResponse> {
            (*self.0.stub)
                .list_secrets(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::ListSecretsResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone().unwrap_or_default();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<crate::model::ListSecretsResponse, gax::error::Error>
        {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [project][crate::model::secret_manager_service::ListSecretsRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::secret_manager_service::ListSecretsRequest::page_size].
        pub fn set_page_size<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i32>,
        {
            self.0.request.page_size = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [page_size][crate::model::secret_manager_service::ListSecretsRequest::page_size].
        pub fn set_or_clear_page_size<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i32>,
        {
            self.0.request.page_size = v.map(|x| x.into());
            self
        }

        /// Sets the value of [page_token][crate::model::secret_manager_service::ListSecretsRequest::page_token].
        pub fn set_page_token<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.page_token = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [page_token][crate::model::secret_manager_service::ListSecretsRequest::page_token].
        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.page_token = v.map(|x| x.into());
            self
        }

        /// Sets the value of [filter][crate::model::secret_manager_service::ListSecretsRequest::filter].
        pub fn set_filter<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.filter = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [filter][crate::model::secret_manager_service::ListSecretsRequest::filter].
        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.filter = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListSecrets {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::create_secret][crate::client::SecretManagerService::create_secret] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::CreateSecret;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateSecret {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateSecret(
        RequestBuilder<crate::model::secret_manager_service::CreateSecretRequest>,
    );

    impl CreateSecret {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::secret_manager_service::CreateSecretRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Secret> {
            (*self.0.stub)
                .create_secret(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::secret_manager_service::CreateSecretRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [secret_id][crate::model::secret_manager_service::CreateSecretRequest::secret_id].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret_id = v.into();
            self
        }

        /// Sets the value of [body][crate::model::secret_manager_service::CreateSecretRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Secret>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::secret_manager_service::CreateSecretRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Secret>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateSecret {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::list_secrets_by_project_and_location][crate::client::SecretManagerService::list_secrets_by_project_and_location] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::ListSecretsByProjectAndLocation;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListSecretsByProjectAndLocation {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListSecretsByProjectAndLocation(
        RequestBuilder<
            crate::model::secret_manager_service::ListSecretsByProjectAndLocationRequest,
        >,
    );

    impl ListSecretsByProjectAndLocation {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<
            V: Into<crate::model::secret_manager_service::ListSecretsByProjectAndLocationRequest>,
        >(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListSecretsResponse> {
            (*self.0.stub)
                .list_secrets_by_project_and_location(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::ListSecretsResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone().unwrap_or_default();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<crate::model::ListSecretsResponse, gax::error::Error>
        {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [project][crate::model::secret_manager_service::ListSecretsByProjectAndLocationRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [location][crate::model::secret_manager_service::ListSecretsByProjectAndLocationRequest::location].
        ///
        /// This is a **required** field for requests.
        pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.location = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::secret_manager_service::ListSecretsByProjectAndLocationRequest::page_size].
        pub fn set_page_size<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i32>,
        {
            self.0.request.page_size = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [page_size][crate::model::secret_manager_service::ListSecretsByProjectAndLocationRequest::page_size].
        pub fn set_or_clear_page_size<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i32>,
        {
            self.0.request.page_size = v.map(|x| x.into());
            self
        }

        /// Sets the value of [page_token][crate::model::secret_manager_service::ListSecretsByProjectAndLocationRequest::page_token].
        pub fn set_page_token<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.page_token = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [page_token][crate::model::secret_manager_service::ListSecretsByProjectAndLocationRequest::page_token].
        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.page_token = v.map(|x| x.into());
            self
        }

        /// Sets the value of [filter][crate::model::secret_manager_service::ListSecretsByProjectAndLocationRequest::filter].
        pub fn set_filter<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.filter = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [filter][crate::model::secret_manager_service::ListSecretsByProjectAndLocationRequest::filter].
        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.filter = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListSecretsByProjectAndLocation {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::create_secret_by_project_and_location][crate::client::SecretManagerService::create_secret_by_project_and_location] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::CreateSecretByProjectAndLocation;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> CreateSecretByProjectAndLocation {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct CreateSecretByProjectAndLocation(
        RequestBuilder<
            crate::model::secret_manager_service::CreateSecretByProjectAndLocationRequest,
        >,
    );

    impl CreateSecretByProjectAndLocation {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<
            V: Into<crate::model::secret_manager_service::CreateSecretByProjectAndLocationRequest>,
        >(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Secret> {
            (*self.0.stub)
                .create_secret_by_project_and_location(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::secret_manager_service::CreateSecretByProjectAndLocationRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [location][crate::model::secret_manager_service::CreateSecretByProjectAndLocationRequest::location].
        ///
        /// This is a **required** field for requests.
        pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.location = v.into();
            self
        }

        /// Sets the value of [secret_id][crate::model::secret_manager_service::CreateSecretByProjectAndLocationRequest::secret_id].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret_id<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret_id = v.into();
            self
        }

        /// Sets the value of [body][crate::model::secret_manager_service::CreateSecretByProjectAndLocationRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Secret>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::secret_manager_service::CreateSecretByProjectAndLocationRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Secret>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for CreateSecretByProjectAndLocation {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::add_secret_version][crate::client::SecretManagerService::add_secret_version] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::AddSecretVersion;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> AddSecretVersion {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct AddSecretVersion(
        RequestBuilder<crate::model::secret_manager_service::AddSecretVersionRequest>,
    );

    impl AddSecretVersion {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<
            V: Into<crate::model::secret_manager_service::AddSecretVersionRequest>,
        >(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SecretVersion> {
            (*self.0.stub)
                .add_secret_version(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::secret_manager_service::AddSecretVersionRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [secret][crate::model::secret_manager_service::AddSecretVersionRequest::secret].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret = v.into();
            self
        }

        /// Sets the value of [body][crate::model::secret_manager_service::AddSecretVersionRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::AddSecretVersionRequest>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::secret_manager_service::AddSecretVersionRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::AddSecretVersionRequest>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for AddSecretVersion {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::add_secret_version_by_project_and_location_and_secret][crate::client::SecretManagerService::add_secret_version_by_project_and_location_and_secret] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::AddSecretVersionByProjectAndLocationAndSecret;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> AddSecretVersionByProjectAndLocationAndSecret {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct AddSecretVersionByProjectAndLocationAndSecret(RequestBuilder<crate::model::secret_manager_service::AddSecretVersionByProjectAndLocationAndSecretRequest>);

    impl AddSecretVersionByProjectAndLocationAndSecret {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::secret_manager_service::AddSecretVersionByProjectAndLocationAndSecretRequest>>(mut self, v: V) -> Self{
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SecretVersion> {
            (*self.0.stub)
                .add_secret_version_by_project_and_location_and_secret(
                    self.0.request,
                    self.0.options,
                )
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::secret_manager_service::AddSecretVersionByProjectAndLocationAndSecretRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [location][crate::model::secret_manager_service::AddSecretVersionByProjectAndLocationAndSecretRequest::location].
        ///
        /// This is a **required** field for requests.
        pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.location = v.into();
            self
        }

        /// Sets the value of [secret][crate::model::secret_manager_service::AddSecretVersionByProjectAndLocationAndSecretRequest::secret].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret = v.into();
            self
        }

        /// Sets the value of [body][crate::model::secret_manager_service::AddSecretVersionByProjectAndLocationAndSecretRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::AddSecretVersionRequest>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::secret_manager_service::AddSecretVersionByProjectAndLocationAndSecretRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::AddSecretVersionRequest>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for AddSecretVersionByProjectAndLocationAndSecret {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::get_secret][crate::client::SecretManagerService::get_secret] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::GetSecret;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetSecret {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetSecret(RequestBuilder<crate::model::secret_manager_service::GetSecretRequest>);

    impl GetSecret {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::secret_manager_service::GetSecretRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Secret> {
            (*self.0.stub)
                .get_secret(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::secret_manager_service::GetSecretRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [secret][crate::model::secret_manager_service::GetSecretRequest::secret].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetSecret {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::delete_secret][crate::client::SecretManagerService::delete_secret] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::DeleteSecret;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteSecret {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteSecret(
        RequestBuilder<crate::model::secret_manager_service::DeleteSecretRequest>,
    );

    impl DeleteSecret {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::secret_manager_service::DeleteSecretRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Empty> {
            (*self.0.stub)
                .delete_secret(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::secret_manager_service::DeleteSecretRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [secret][crate::model::secret_manager_service::DeleteSecretRequest::secret].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret = v.into();
            self
        }

        /// Sets the value of [etag][crate::model::secret_manager_service::DeleteSecretRequest::etag].
        pub fn set_etag<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.etag = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [etag][crate::model::secret_manager_service::DeleteSecretRequest::etag].
        pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.etag = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteSecret {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::update_secret][crate::client::SecretManagerService::update_secret] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::UpdateSecret;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UpdateSecret {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UpdateSecret(
        RequestBuilder<crate::model::secret_manager_service::UpdateSecretRequest>,
    );

    impl UpdateSecret {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::secret_manager_service::UpdateSecretRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Secret> {
            (*self.0.stub)
                .update_secret(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::secret_manager_service::UpdateSecretRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [secret][crate::model::secret_manager_service::UpdateSecretRequest::secret].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret = v.into();
            self
        }

        /// Sets the value of [update_mask][crate::model::secret_manager_service::UpdateSecretRequest::update_mask].
        ///
        /// This is a **required** field for requests.
        pub fn set_update_mask<T: Into<wkt::FieldMask>>(mut self, v: T) -> Self {
            self.0.request.update_mask = v.into();
            self
        }

        /// Sets the value of [body][crate::model::secret_manager_service::UpdateSecretRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Secret>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::secret_manager_service::UpdateSecretRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Secret>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UpdateSecret {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::get_secret_by_project_and_location_and_secret][crate::client::SecretManagerService::get_secret_by_project_and_location_and_secret] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::GetSecretByProjectAndLocationAndSecret;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetSecretByProjectAndLocationAndSecret {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetSecretByProjectAndLocationAndSecret(
        RequestBuilder<
            crate::model::secret_manager_service::GetSecretByProjectAndLocationAndSecretRequest,
        >,
    );

    impl GetSecretByProjectAndLocationAndSecret {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<
            V: Into<
                crate::model::secret_manager_service::GetSecretByProjectAndLocationAndSecretRequest,
            >,
        >(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Secret> {
            (*self.0.stub)
                .get_secret_by_project_and_location_and_secret(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::secret_manager_service::GetSecretByProjectAndLocationAndSecretRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [location][crate::model::secret_manager_service::GetSecretByProjectAndLocationAndSecretRequest::location].
        ///
        /// This is a **required** field for requests.
        pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.location = v.into();
            self
        }

        /// Sets the value of [secret][crate::model::secret_manager_service::GetSecretByProjectAndLocationAndSecretRequest::secret].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetSecretByProjectAndLocationAndSecret {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::delete_secret_by_project_and_location_and_secret][crate::client::SecretManagerService::delete_secret_by_project_and_location_and_secret] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::DeleteSecretByProjectAndLocationAndSecret;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DeleteSecretByProjectAndLocationAndSecret {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DeleteSecretByProjectAndLocationAndSecret(
        RequestBuilder<
            crate::model::secret_manager_service::DeleteSecretByProjectAndLocationAndSecretRequest,
        >,
    );

    impl DeleteSecretByProjectAndLocationAndSecret {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::secret_manager_service::DeleteSecretByProjectAndLocationAndSecretRequest>>(mut self, v: V) -> Self{
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Empty> {
            (*self.0.stub)
                .delete_secret_by_project_and_location_and_secret(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::secret_manager_service::DeleteSecretByProjectAndLocationAndSecretRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [location][crate::model::secret_manager_service::DeleteSecretByProjectAndLocationAndSecretRequest::location].
        ///
        /// This is a **required** field for requests.
        pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.location = v.into();
            self
        }

        /// Sets the value of [secret][crate::model::secret_manager_service::DeleteSecretByProjectAndLocationAndSecretRequest::secret].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret = v.into();
            self
        }

        /// Sets the value of [etag][crate::model::secret_manager_service::DeleteSecretByProjectAndLocationAndSecretRequest::etag].
        pub fn set_etag<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.etag = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [etag][crate::model::secret_manager_service::DeleteSecretByProjectAndLocationAndSecretRequest::etag].
        pub fn set_or_clear_etag<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.etag = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DeleteSecretByProjectAndLocationAndSecret {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::update_secret_by_project_and_location_and_secret][crate::client::SecretManagerService::update_secret_by_project_and_location_and_secret] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::UpdateSecretByProjectAndLocationAndSecret;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> UpdateSecretByProjectAndLocationAndSecret {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct UpdateSecretByProjectAndLocationAndSecret(
        RequestBuilder<
            crate::model::secret_manager_service::UpdateSecretByProjectAndLocationAndSecretRequest,
        >,
    );

    impl UpdateSecretByProjectAndLocationAndSecret {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::secret_manager_service::UpdateSecretByProjectAndLocationAndSecretRequest>>(mut self, v: V) -> Self{
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Secret> {
            (*self.0.stub)
                .update_secret_by_project_and_location_and_secret(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::secret_manager_service::UpdateSecretByProjectAndLocationAndSecretRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [location][crate::model::secret_manager_service::UpdateSecretByProjectAndLocationAndSecretRequest::location].
        ///
        /// This is a **required** field for requests.
        pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.location = v.into();
            self
        }

        /// Sets the value of [secret][crate::model::secret_manager_service::UpdateSecretByProjectAndLocationAndSecretRequest::secret].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret = v.into();
            self
        }

        /// Sets the value of [update_mask][crate::model::secret_manager_service::UpdateSecretByProjectAndLocationAndSecretRequest::update_mask].
        ///
        /// This is a **required** field for requests.
        pub fn set_update_mask<T: Into<wkt::FieldMask>>(mut self, v: T) -> Self {
            self.0.request.update_mask = v.into();
            self
        }

        /// Sets the value of [body][crate::model::secret_manager_service::UpdateSecretByProjectAndLocationAndSecretRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::Secret>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::secret_manager_service::UpdateSecretByProjectAndLocationAndSecretRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::Secret>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for UpdateSecretByProjectAndLocationAndSecret {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::list_secret_versions][crate::client::SecretManagerService::list_secret_versions] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::ListSecretVersions;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListSecretVersions {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListSecretVersions(
        RequestBuilder<crate::model::secret_manager_service::ListSecretVersionsRequest>,
    );

    impl ListSecretVersions {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<
            V: Into<crate::model::secret_manager_service::ListSecretVersionsRequest>,
        >(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListSecretVersionsResponse> {
            (*self.0.stub)
                .list_secret_versions(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::ListSecretVersionsResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone().unwrap_or_default();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<
            crate::model::ListSecretVersionsResponse,
            gax::error::Error,
        > {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [project][crate::model::secret_manager_service::ListSecretVersionsRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [secret][crate::model::secret_manager_service::ListSecretVersionsRequest::secret].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::secret_manager_service::ListSecretVersionsRequest::page_size].
        pub fn set_page_size<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i32>,
        {
            self.0.request.page_size = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [page_size][crate::model::secret_manager_service::ListSecretVersionsRequest::page_size].
        pub fn set_or_clear_page_size<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i32>,
        {
            self.0.request.page_size = v.map(|x| x.into());
            self
        }

        /// Sets the value of [page_token][crate::model::secret_manager_service::ListSecretVersionsRequest::page_token].
        pub fn set_page_token<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.page_token = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [page_token][crate::model::secret_manager_service::ListSecretVersionsRequest::page_token].
        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.page_token = v.map(|x| x.into());
            self
        }

        /// Sets the value of [filter][crate::model::secret_manager_service::ListSecretVersionsRequest::filter].
        pub fn set_filter<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.filter = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [filter][crate::model::secret_manager_service::ListSecretVersionsRequest::filter].
        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.filter = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListSecretVersions {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::list_secret_versions_by_project_and_location_and_secret][crate::client::SecretManagerService::list_secret_versions_by_project_and_location_and_secret] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::ListSecretVersionsByProjectAndLocationAndSecret;
    /// # tokio_test::block_on(async {
    /// use gax::paginator::ItemPaginator;
    ///
    /// let builder = prepare_request_builder();
    /// let mut items = builder.by_item();
    /// while let Some(result) = items.next().await {
    ///   let item = result?;
    /// }
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> ListSecretVersionsByProjectAndLocationAndSecret {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct ListSecretVersionsByProjectAndLocationAndSecret(RequestBuilder<crate::model::secret_manager_service::ListSecretVersionsByProjectAndLocationAndSecretRequest>);

    impl ListSecretVersionsByProjectAndLocationAndSecret {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::secret_manager_service::ListSecretVersionsByProjectAndLocationAndSecretRequest>>(mut self, v: V) -> Self{
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::ListSecretVersionsResponse> {
            (*self.0.stub)
                .list_secret_versions_by_project_and_location_and_secret(
                    self.0.request,
                    self.0.options,
                )
                .await
                .map(gax::response::Response::into_body)
        }

        /// Streams each page in the collection.
        pub fn by_page(
            self,
        ) -> impl gax::paginator::Paginator<crate::model::ListSecretVersionsResponse, gax::error::Error>
        {
            use std::clone::Clone;
            let token = self.0.request.page_token.clone().unwrap_or_default();
            let execute = move |token: String| {
                let mut builder = self.clone();
                builder.0.request = builder.0.request.set_page_token(token);
                builder.send()
            };
            gax::paginator::internal::new_paginator(token, execute)
        }

        /// Streams each item in the collection.
        pub fn by_item(
            self,
        ) -> impl gax::paginator::ItemPaginator<
            crate::model::ListSecretVersionsResponse,
            gax::error::Error,
        > {
            use gax::paginator::Paginator;
            self.by_page().items()
        }

        /// Sets the value of [project][crate::model::secret_manager_service::ListSecretVersionsByProjectAndLocationAndSecretRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [location][crate::model::secret_manager_service::ListSecretVersionsByProjectAndLocationAndSecretRequest::location].
        ///
        /// This is a **required** field for requests.
        pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.location = v.into();
            self
        }

        /// Sets the value of [secret][crate::model::secret_manager_service::ListSecretVersionsByProjectAndLocationAndSecretRequest::secret].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret = v.into();
            self
        }

        /// Sets the value of [page_size][crate::model::secret_manager_service::ListSecretVersionsByProjectAndLocationAndSecretRequest::page_size].
        pub fn set_page_size<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i32>,
        {
            self.0.request.page_size = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [page_size][crate::model::secret_manager_service::ListSecretVersionsByProjectAndLocationAndSecretRequest::page_size].
        pub fn set_or_clear_page_size<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<i32>,
        {
            self.0.request.page_size = v.map(|x| x.into());
            self
        }

        /// Sets the value of [page_token][crate::model::secret_manager_service::ListSecretVersionsByProjectAndLocationAndSecretRequest::page_token].
        pub fn set_page_token<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.page_token = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [page_token][crate::model::secret_manager_service::ListSecretVersionsByProjectAndLocationAndSecretRequest::page_token].
        pub fn set_or_clear_page_token<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.page_token = v.map(|x| x.into());
            self
        }

        /// Sets the value of [filter][crate::model::secret_manager_service::ListSecretVersionsByProjectAndLocationAndSecretRequest::filter].
        pub fn set_filter<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.filter = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [filter][crate::model::secret_manager_service::ListSecretVersionsByProjectAndLocationAndSecretRequest::filter].
        pub fn set_or_clear_filter<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<std::string::String>,
        {
            self.0.request.filter = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for ListSecretVersionsByProjectAndLocationAndSecret {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::get_secret_version][crate::client::SecretManagerService::get_secret_version] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::GetSecretVersion;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetSecretVersion {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetSecretVersion(
        RequestBuilder<crate::model::secret_manager_service::GetSecretVersionRequest>,
    );

    impl GetSecretVersion {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<
            V: Into<crate::model::secret_manager_service::GetSecretVersionRequest>,
        >(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SecretVersion> {
            (*self.0.stub)
                .get_secret_version(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::secret_manager_service::GetSecretVersionRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [secret][crate::model::secret_manager_service::GetSecretVersionRequest::secret].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret = v.into();
            self
        }

        /// Sets the value of [version][crate::model::secret_manager_service::GetSecretVersionRequest::version].
        ///
        /// This is a **required** field for requests.
        pub fn set_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.version = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetSecretVersion {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::get_secret_version_by_project_and_location_and_secret_and_version][crate::client::SecretManagerService::get_secret_version_by_project_and_location_and_secret_and_version] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::GetSecretVersionByProjectAndLocationAndSecretAndVersion;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetSecretVersionByProjectAndLocationAndSecretAndVersion {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetSecretVersionByProjectAndLocationAndSecretAndVersion(RequestBuilder<crate::model::secret_manager_service::GetSecretVersionByProjectAndLocationAndSecretAndVersionRequest>);

    impl GetSecretVersionByProjectAndLocationAndSecretAndVersion {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::secret_manager_service::GetSecretVersionByProjectAndLocationAndSecretAndVersionRequest>>(mut self, v: V) -> Self{
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SecretVersion> {
            (*self.0.stub)
                .get_secret_version_by_project_and_location_and_secret_and_version(
                    self.0.request,
                    self.0.options,
                )
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::secret_manager_service::GetSecretVersionByProjectAndLocationAndSecretAndVersionRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [location][crate::model::secret_manager_service::GetSecretVersionByProjectAndLocationAndSecretAndVersionRequest::location].
        ///
        /// This is a **required** field for requests.
        pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.location = v.into();
            self
        }

        /// Sets the value of [secret][crate::model::secret_manager_service::GetSecretVersionByProjectAndLocationAndSecretAndVersionRequest::secret].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret = v.into();
            self
        }

        /// Sets the value of [version][crate::model::secret_manager_service::GetSecretVersionByProjectAndLocationAndSecretAndVersionRequest::version].
        ///
        /// This is a **required** field for requests.
        pub fn set_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.version = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder
        for GetSecretVersionByProjectAndLocationAndSecretAndVersion
    {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::access_secret_version][crate::client::SecretManagerService::access_secret_version] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::AccessSecretVersion;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> AccessSecretVersion {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct AccessSecretVersion(
        RequestBuilder<crate::model::secret_manager_service::AccessSecretVersionRequest>,
    );

    impl AccessSecretVersion {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<
            V: Into<crate::model::secret_manager_service::AccessSecretVersionRequest>,
        >(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::AccessSecretVersionResponse> {
            (*self.0.stub)
                .access_secret_version(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::secret_manager_service::AccessSecretVersionRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [secret][crate::model::secret_manager_service::AccessSecretVersionRequest::secret].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret = v.into();
            self
        }

        /// Sets the value of [version][crate::model::secret_manager_service::AccessSecretVersionRequest::version].
        ///
        /// This is a **required** field for requests.
        pub fn set_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.version = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for AccessSecretVersion {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::access_secret_version_by_project_and_location_and_secret_and_version][crate::client::SecretManagerService::access_secret_version_by_project_and_location_and_secret_and_version] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::AccessSecretVersionByProjectAndLocationAndSecretAndVersion;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> AccessSecretVersionByProjectAndLocationAndSecretAndVersion {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct AccessSecretVersionByProjectAndLocationAndSecretAndVersion(RequestBuilder<crate::model::secret_manager_service::AccessSecretVersionByProjectAndLocationAndSecretAndVersionRequest>);

    impl AccessSecretVersionByProjectAndLocationAndSecretAndVersion {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::secret_manager_service::AccessSecretVersionByProjectAndLocationAndSecretAndVersionRequest>>(mut self, v: V) -> Self{
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::AccessSecretVersionResponse> {
            (*self.0.stub)
                .access_secret_version_by_project_and_location_and_secret_and_version(
                    self.0.request,
                    self.0.options,
                )
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::secret_manager_service::AccessSecretVersionByProjectAndLocationAndSecretAndVersionRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [location][crate::model::secret_manager_service::AccessSecretVersionByProjectAndLocationAndSecretAndVersionRequest::location].
        ///
        /// This is a **required** field for requests.
        pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.location = v.into();
            self
        }

        /// Sets the value of [secret][crate::model::secret_manager_service::AccessSecretVersionByProjectAndLocationAndSecretAndVersionRequest::secret].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret = v.into();
            self
        }

        /// Sets the value of [version][crate::model::secret_manager_service::AccessSecretVersionByProjectAndLocationAndSecretAndVersionRequest::version].
        ///
        /// This is a **required** field for requests.
        pub fn set_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.version = v.into();
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder
        for AccessSecretVersionByProjectAndLocationAndSecretAndVersion
    {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::disable_secret_version][crate::client::SecretManagerService::disable_secret_version] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::DisableSecretVersion;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DisableSecretVersion {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DisableSecretVersion(
        RequestBuilder<crate::model::secret_manager_service::DisableSecretVersionRequest>,
    );

    impl DisableSecretVersion {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<
            V: Into<crate::model::secret_manager_service::DisableSecretVersionRequest>,
        >(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SecretVersion> {
            (*self.0.stub)
                .disable_secret_version(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::secret_manager_service::DisableSecretVersionRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [secret][crate::model::secret_manager_service::DisableSecretVersionRequest::secret].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret = v.into();
            self
        }

        /// Sets the value of [version][crate::model::secret_manager_service::DisableSecretVersionRequest::version].
        ///
        /// This is a **required** field for requests.
        pub fn set_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.version = v.into();
            self
        }

        /// Sets the value of [body][crate::model::secret_manager_service::DisableSecretVersionRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::DisableSecretVersionRequest>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::secret_manager_service::DisableSecretVersionRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::DisableSecretVersionRequest>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DisableSecretVersion {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::disable_secret_version_by_project_and_location_and_secret_and_version][crate::client::SecretManagerService::disable_secret_version_by_project_and_location_and_secret_and_version] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::DisableSecretVersionByProjectAndLocationAndSecretAndVersion;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DisableSecretVersionByProjectAndLocationAndSecretAndVersion {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DisableSecretVersionByProjectAndLocationAndSecretAndVersion(RequestBuilder<crate::model::secret_manager_service::DisableSecretVersionByProjectAndLocationAndSecretAndVersionRequest>);

    impl DisableSecretVersionByProjectAndLocationAndSecretAndVersion {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::secret_manager_service::DisableSecretVersionByProjectAndLocationAndSecretAndVersionRequest>>(mut self, v: V) -> Self{
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SecretVersion> {
            (*self.0.stub)
                .disable_secret_version_by_project_and_location_and_secret_and_version(
                    self.0.request,
                    self.0.options,
                )
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::secret_manager_service::DisableSecretVersionByProjectAndLocationAndSecretAndVersionRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [location][crate::model::secret_manager_service::DisableSecretVersionByProjectAndLocationAndSecretAndVersionRequest::location].
        ///
        /// This is a **required** field for requests.
        pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.location = v.into();
            self
        }

        /// Sets the value of [secret][crate::model::secret_manager_service::DisableSecretVersionByProjectAndLocationAndSecretAndVersionRequest::secret].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret = v.into();
            self
        }

        /// Sets the value of [version][crate::model::secret_manager_service::DisableSecretVersionByProjectAndLocationAndSecretAndVersionRequest::version].
        ///
        /// This is a **required** field for requests.
        pub fn set_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.version = v.into();
            self
        }

        /// Sets the value of [body][crate::model::secret_manager_service::DisableSecretVersionByProjectAndLocationAndSecretAndVersionRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::DisableSecretVersionRequest>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::secret_manager_service::DisableSecretVersionByProjectAndLocationAndSecretAndVersionRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::DisableSecretVersionRequest>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder
        for DisableSecretVersionByProjectAndLocationAndSecretAndVersion
    {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::enable_secret_version][crate::client::SecretManagerService::enable_secret_version] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::EnableSecretVersion;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> EnableSecretVersion {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct EnableSecretVersion(
        RequestBuilder<crate::model::secret_manager_service::EnableSecretVersionRequest>,
    );

    impl EnableSecretVersion {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<
            V: Into<crate::model::secret_manager_service::EnableSecretVersionRequest>,
        >(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SecretVersion> {
            (*self.0.stub)
                .enable_secret_version(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::secret_manager_service::EnableSecretVersionRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [secret][crate::model::secret_manager_service::EnableSecretVersionRequest::secret].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret = v.into();
            self
        }

        /// Sets the value of [version][crate::model::secret_manager_service::EnableSecretVersionRequest::version].
        ///
        /// This is a **required** field for requests.
        pub fn set_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.version = v.into();
            self
        }

        /// Sets the value of [body][crate::model::secret_manager_service::EnableSecretVersionRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::EnableSecretVersionRequest>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::secret_manager_service::EnableSecretVersionRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::EnableSecretVersionRequest>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for EnableSecretVersion {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::enable_secret_version_by_project_and_location_and_secret_and_version][crate::client::SecretManagerService::enable_secret_version_by_project_and_location_and_secret_and_version] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::EnableSecretVersionByProjectAndLocationAndSecretAndVersion;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> EnableSecretVersionByProjectAndLocationAndSecretAndVersion {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct EnableSecretVersionByProjectAndLocationAndSecretAndVersion(RequestBuilder<crate::model::secret_manager_service::EnableSecretVersionByProjectAndLocationAndSecretAndVersionRequest>);

    impl EnableSecretVersionByProjectAndLocationAndSecretAndVersion {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::secret_manager_service::EnableSecretVersionByProjectAndLocationAndSecretAndVersionRequest>>(mut self, v: V) -> Self{
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SecretVersion> {
            (*self.0.stub)
                .enable_secret_version_by_project_and_location_and_secret_and_version(
                    self.0.request,
                    self.0.options,
                )
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::secret_manager_service::EnableSecretVersionByProjectAndLocationAndSecretAndVersionRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [location][crate::model::secret_manager_service::EnableSecretVersionByProjectAndLocationAndSecretAndVersionRequest::location].
        ///
        /// This is a **required** field for requests.
        pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.location = v.into();
            self
        }

        /// Sets the value of [secret][crate::model::secret_manager_service::EnableSecretVersionByProjectAndLocationAndSecretAndVersionRequest::secret].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret = v.into();
            self
        }

        /// Sets the value of [version][crate::model::secret_manager_service::EnableSecretVersionByProjectAndLocationAndSecretAndVersionRequest::version].
        ///
        /// This is a **required** field for requests.
        pub fn set_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.version = v.into();
            self
        }

        /// Sets the value of [body][crate::model::secret_manager_service::EnableSecretVersionByProjectAndLocationAndSecretAndVersionRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::EnableSecretVersionRequest>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::secret_manager_service::EnableSecretVersionByProjectAndLocationAndSecretAndVersionRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::EnableSecretVersionRequest>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder
        for EnableSecretVersionByProjectAndLocationAndSecretAndVersion
    {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::destroy_secret_version][crate::client::SecretManagerService::destroy_secret_version] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::DestroySecretVersion;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DestroySecretVersion {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DestroySecretVersion(
        RequestBuilder<crate::model::secret_manager_service::DestroySecretVersionRequest>,
    );

    impl DestroySecretVersion {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<
            V: Into<crate::model::secret_manager_service::DestroySecretVersionRequest>,
        >(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SecretVersion> {
            (*self.0.stub)
                .destroy_secret_version(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::secret_manager_service::DestroySecretVersionRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [secret][crate::model::secret_manager_service::DestroySecretVersionRequest::secret].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret = v.into();
            self
        }

        /// Sets the value of [version][crate::model::secret_manager_service::DestroySecretVersionRequest::version].
        ///
        /// This is a **required** field for requests.
        pub fn set_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.version = v.into();
            self
        }

        /// Sets the value of [body][crate::model::secret_manager_service::DestroySecretVersionRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::DestroySecretVersionRequest>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::secret_manager_service::DestroySecretVersionRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::DestroySecretVersionRequest>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for DestroySecretVersion {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::destroy_secret_version_by_project_and_location_and_secret_and_version][crate::client::SecretManagerService::destroy_secret_version_by_project_and_location_and_secret_and_version] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::DestroySecretVersionByProjectAndLocationAndSecretAndVersion;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> DestroySecretVersionByProjectAndLocationAndSecretAndVersion {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct DestroySecretVersionByProjectAndLocationAndSecretAndVersion(RequestBuilder<crate::model::secret_manager_service::DestroySecretVersionByProjectAndLocationAndSecretAndVersionRequest>);

    impl DestroySecretVersionByProjectAndLocationAndSecretAndVersion {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::secret_manager_service::DestroySecretVersionByProjectAndLocationAndSecretAndVersionRequest>>(mut self, v: V) -> Self{
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::SecretVersion> {
            (*self.0.stub)
                .destroy_secret_version_by_project_and_location_and_secret_and_version(
                    self.0.request,
                    self.0.options,
                )
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::secret_manager_service::DestroySecretVersionByProjectAndLocationAndSecretAndVersionRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [location][crate::model::secret_manager_service::DestroySecretVersionByProjectAndLocationAndSecretAndVersionRequest::location].
        ///
        /// This is a **required** field for requests.
        pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.location = v.into();
            self
        }

        /// Sets the value of [secret][crate::model::secret_manager_service::DestroySecretVersionByProjectAndLocationAndSecretAndVersionRequest::secret].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret = v.into();
            self
        }

        /// Sets the value of [version][crate::model::secret_manager_service::DestroySecretVersionByProjectAndLocationAndSecretAndVersionRequest::version].
        ///
        /// This is a **required** field for requests.
        pub fn set_version<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.version = v.into();
            self
        }

        /// Sets the value of [body][crate::model::secret_manager_service::DestroySecretVersionByProjectAndLocationAndSecretAndVersionRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::DestroySecretVersionRequest>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::secret_manager_service::DestroySecretVersionByProjectAndLocationAndSecretAndVersionRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::DestroySecretVersionRequest>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder
        for DestroySecretVersionByProjectAndLocationAndSecretAndVersion
    {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::set_iam_policy][crate::client::SecretManagerService::set_iam_policy] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::SetIamPolicy;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> SetIamPolicy {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct SetIamPolicy(
        RequestBuilder<crate::model::secret_manager_service::SetIamPolicyRequest>,
    );

    impl SetIamPolicy {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::secret_manager_service::SetIamPolicyRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Policy> {
            (*self.0.stub)
                .set_iam_policy(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::secret_manager_service::SetIamPolicyRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [secret][crate::model::secret_manager_service::SetIamPolicyRequest::secret].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret = v.into();
            self
        }

        /// Sets the value of [body][crate::model::secret_manager_service::SetIamPolicyRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::SetIamPolicyRequest>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::secret_manager_service::SetIamPolicyRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::SetIamPolicyRequest>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for SetIamPolicy {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::set_iam_policy_by_project_and_location_and_secret][crate::client::SecretManagerService::set_iam_policy_by_project_and_location_and_secret] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::SetIamPolicyByProjectAndLocationAndSecret;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> SetIamPolicyByProjectAndLocationAndSecret {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct SetIamPolicyByProjectAndLocationAndSecret(
        RequestBuilder<
            crate::model::secret_manager_service::SetIamPolicyByProjectAndLocationAndSecretRequest,
        >,
    );

    impl SetIamPolicyByProjectAndLocationAndSecret {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::secret_manager_service::SetIamPolicyByProjectAndLocationAndSecretRequest>>(mut self, v: V) -> Self{
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Policy> {
            (*self.0.stub)
                .set_iam_policy_by_project_and_location_and_secret(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::secret_manager_service::SetIamPolicyByProjectAndLocationAndSecretRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [location][crate::model::secret_manager_service::SetIamPolicyByProjectAndLocationAndSecretRequest::location].
        ///
        /// This is a **required** field for requests.
        pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.location = v.into();
            self
        }

        /// Sets the value of [secret][crate::model::secret_manager_service::SetIamPolicyByProjectAndLocationAndSecretRequest::secret].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret = v.into();
            self
        }

        /// Sets the value of [body][crate::model::secret_manager_service::SetIamPolicyByProjectAndLocationAndSecretRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::SetIamPolicyRequest>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::secret_manager_service::SetIamPolicyByProjectAndLocationAndSecretRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::SetIamPolicyRequest>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for SetIamPolicyByProjectAndLocationAndSecret {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::get_iam_policy][crate::client::SecretManagerService::get_iam_policy] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::GetIamPolicy;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetIamPolicy {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetIamPolicy(
        RequestBuilder<crate::model::secret_manager_service::GetIamPolicyRequest>,
    );

    impl GetIamPolicy {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::secret_manager_service::GetIamPolicyRequest>>(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Policy> {
            (*self.0.stub)
                .get_iam_policy(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::secret_manager_service::GetIamPolicyRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [secret][crate::model::secret_manager_service::GetIamPolicyRequest::secret].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret = v.into();
            self
        }

        /// Sets the value of [options_requested_policy_version][crate::model::secret_manager_service::GetIamPolicyRequest::options_requested_policy_version].
        pub fn set_options_requested_policy_version<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i32>,
        {
            self.0.request.options_requested_policy_version = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [options_requested_policy_version][crate::model::secret_manager_service::GetIamPolicyRequest::options_requested_policy_version].
        pub fn set_or_clear_options_requested_policy_version<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<i32>,
        {
            self.0.request.options_requested_policy_version = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetIamPolicy {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::get_iam_policy_by_project_and_location_and_secret][crate::client::SecretManagerService::get_iam_policy_by_project_and_location_and_secret] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::GetIamPolicyByProjectAndLocationAndSecret;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> GetIamPolicyByProjectAndLocationAndSecret {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct GetIamPolicyByProjectAndLocationAndSecret(
        RequestBuilder<
            crate::model::secret_manager_service::GetIamPolicyByProjectAndLocationAndSecretRequest,
        >,
    );

    impl GetIamPolicyByProjectAndLocationAndSecret {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::secret_manager_service::GetIamPolicyByProjectAndLocationAndSecretRequest>>(mut self, v: V) -> Self{
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::Policy> {
            (*self.0.stub)
                .get_iam_policy_by_project_and_location_and_secret(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::secret_manager_service::GetIamPolicyByProjectAndLocationAndSecretRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [location][crate::model::secret_manager_service::GetIamPolicyByProjectAndLocationAndSecretRequest::location].
        ///
        /// This is a **required** field for requests.
        pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.location = v.into();
            self
        }

        /// Sets the value of [secret][crate::model::secret_manager_service::GetIamPolicyByProjectAndLocationAndSecretRequest::secret].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret = v.into();
            self
        }

        /// Sets the value of [options_requested_policy_version][crate::model::secret_manager_service::GetIamPolicyByProjectAndLocationAndSecretRequest::options_requested_policy_version].
        pub fn set_options_requested_policy_version<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<i32>,
        {
            self.0.request.options_requested_policy_version = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [options_requested_policy_version][crate::model::secret_manager_service::GetIamPolicyByProjectAndLocationAndSecretRequest::options_requested_policy_version].
        pub fn set_or_clear_options_requested_policy_version<T>(
            mut self,
            v: std::option::Option<T>,
        ) -> Self
        where
            T: std::convert::Into<i32>,
        {
            self.0.request.options_requested_policy_version = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for GetIamPolicyByProjectAndLocationAndSecret {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::test_iam_permissions][crate::client::SecretManagerService::test_iam_permissions] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::TestIamPermissions;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> TestIamPermissions {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct TestIamPermissions(
        RequestBuilder<crate::model::secret_manager_service::TestIamPermissionsRequest>,
    );

    impl TestIamPermissions {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<
            V: Into<crate::model::secret_manager_service::TestIamPermissionsRequest>,
        >(
            mut self,
            v: V,
        ) -> Self {
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::TestIamPermissionsResponse> {
            (*self.0.stub)
                .test_iam_permissions(self.0.request, self.0.options)
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::secret_manager_service::TestIamPermissionsRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [secret][crate::model::secret_manager_service::TestIamPermissionsRequest::secret].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret = v.into();
            self
        }

        /// Sets the value of [body][crate::model::secret_manager_service::TestIamPermissionsRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::TestIamPermissionsRequest>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::secret_manager_service::TestIamPermissionsRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::TestIamPermissionsRequest>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for TestIamPermissions {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }

    /// The request builder for [SecretManagerService::test_iam_permissions_by_project_and_location_and_secret][crate::client::SecretManagerService::test_iam_permissions_by_project_and_location_and_secret] calls.
    ///
    /// # Example
    /// ```no_run
    /// # use secretmanager_openapi_v1::builder;
    /// use builder::secret_manager_service::TestIamPermissionsByProjectAndLocationAndSecret;
    /// # tokio_test::block_on(async {
    ///
    /// let builder = prepare_request_builder();
    /// let response = builder.send().await?;
    /// # gax::Result::<()>::Ok(()) });
    ///
    /// fn prepare_request_builder() -> TestIamPermissionsByProjectAndLocationAndSecret {
    ///   # panic!();
    ///   // ... details omitted ...
    /// }
    /// ```
    #[derive(Clone, Debug)]
    pub struct TestIamPermissionsByProjectAndLocationAndSecret(RequestBuilder<crate::model::secret_manager_service::TestIamPermissionsByProjectAndLocationAndSecretRequest>);

    impl TestIamPermissionsByProjectAndLocationAndSecret {
        pub(crate) fn new(
            stub: std::sync::Arc<dyn super::super::stub::dynamic::SecretManagerService>,
        ) -> Self {
            Self(RequestBuilder::new(stub))
        }

        /// Sets the full request, replacing any prior values.
        pub fn with_request<V: Into<crate::model::secret_manager_service::TestIamPermissionsByProjectAndLocationAndSecretRequest>>(mut self, v: V) -> Self{
            self.0.request = v.into();
            self
        }

        /// Sets all the options, replacing any prior values.
        pub fn with_options<V: Into<gax::options::RequestOptions>>(mut self, v: V) -> Self {
            self.0.options = v.into();
            self
        }

        /// Sends the request.
        pub async fn send(self) -> Result<crate::model::TestIamPermissionsResponse> {
            (*self.0.stub)
                .test_iam_permissions_by_project_and_location_and_secret(
                    self.0.request,
                    self.0.options,
                )
                .await
                .map(gax::response::Response::into_body)
        }

        /// Sets the value of [project][crate::model::secret_manager_service::TestIamPermissionsByProjectAndLocationAndSecretRequest::project].
        ///
        /// This is a **required** field for requests.
        pub fn set_project<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.project = v.into();
            self
        }

        /// Sets the value of [location][crate::model::secret_manager_service::TestIamPermissionsByProjectAndLocationAndSecretRequest::location].
        ///
        /// This is a **required** field for requests.
        pub fn set_location<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.location = v.into();
            self
        }

        /// Sets the value of [secret][crate::model::secret_manager_service::TestIamPermissionsByProjectAndLocationAndSecretRequest::secret].
        ///
        /// This is a **required** field for requests.
        pub fn set_secret<T: Into<std::string::String>>(mut self, v: T) -> Self {
            self.0.request.secret = v.into();
            self
        }

        /// Sets the value of [body][crate::model::secret_manager_service::TestIamPermissionsByProjectAndLocationAndSecretRequest::body].
        pub fn set_body<T>(mut self, v: T) -> Self
        where
            T: std::convert::Into<crate::model::TestIamPermissionsRequest>,
        {
            self.0.request.body = std::option::Option::Some(v.into());
            self
        }

        /// Sets or clears the value of [body][crate::model::secret_manager_service::TestIamPermissionsByProjectAndLocationAndSecretRequest::body].
        pub fn set_or_clear_body<T>(mut self, v: std::option::Option<T>) -> Self
        where
            T: std::convert::Into<crate::model::TestIamPermissionsRequest>,
        {
            self.0.request.body = v.map(|x| x.into());
            self
        }
    }

    #[doc(hidden)]
    impl gax::options::internal::RequestBuilder for TestIamPermissionsByProjectAndLocationAndSecret {
        fn request_options(&mut self) -> &mut gax::options::RequestOptions {
            &mut self.0.options
        }
    }
}
